<?php
namespace app\user\model;

use think\Model;
use think\Db;

class UserModel extends Model
{
    public function addUser($user)
    {
        $res = Db::name('user')->insert($user);
        return $res;
    }

    public function delUser($id)
    {
        $res = Db::name('user')->where('user_id', 'in', $id)->delete();
        return $res;
    }

    public function upUser($user)
    {
        $res = Db::name('user')->where('user_id', $user['user_id'])->update($user);
        return $res;
    }

    public function getUser($user)
    {
        $res = Db::name('user')->where($user)->select();
        return $res;
    }
}
